package leetcode.数组;

import java.util.Vector;

public class 删除重复元素29 {
    public int removeDuplicates(int[] nums) {
        int ans = 0;
        for (int i = 1; i < nums.length; i++) {
            if (nums[ans] != nums[i]) {
                ans ++;
                nums[ans] = nums[i];
            }
        }
        return ++ans;

    }
}
